/**
 * Project Name:trustsql_sdk
 * File Name:Constants.java
 * Package Name:com.tencent.trustsql.sdk
 * Date:Jul 26, 201711:17:18 AM
 * Copyright (c) 2017, Tencent All Rights Reserved.
 */

package com.mindata.blockchain.common;

import java.math.BigInteger;

/**
 * ClassName:Constants <br/>
 *
 * @author wuweifeng
 */
public class Constants {
    private Constants() {
    }

    public static final int PUBKEY_DIGEST_LENGTH = 90; // public key length
    public static final int PRVKEY_DIGEST_LENGTH = 45; //private key length
    public static final int ADDR_DIGEST_LENGTH = 35;   // address length
    public static final int SIGN_DIGEST_LENGTH = 98;   // signature length
    public static final int KEY_DES3_DIGEST_LENGTH = 24;  // max size of key for DES3 encrypt
    public static final int KEY_AES128_DIGEST_LENGTH = 16; // max size of key for AES128 encrypt
    public static final int TRANSSQL_DIGEST_LENGTH = 8192; // max size of trans sql for TrustSQL

    public static final String RANDOM_NUMBER_ALGORITHM = "SHA1PRNG";
    public static final String RANDOM_NUMBER_ALGORITHM_PROVIDER = "SUN";
    public static final BigInteger MAXPRIVATEKEY = new BigInteger("00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140", 16);

    public static final String INFO_SHARE_PUBKEY = "BC8s/4qEAvVl4Sv0LwQOWJcVU6Q5hBd+7LlJeEivVmUbdtwP4RTfN8x/G+muMhN8SrweyyVVMIcIrnMWoFqGfIA=";

    /**
     * 最后一个区块hash的key，value就是最后一个区块的hash
     */
    public static final String KEY_LAST_BLOCK = "key_last_block";
    public static final String KEY_LAST_DGLBLOCK = "key_last_dglsblock";
    /**
     * 第一个区块hash的key，value就是第一个区块的hash
     */
    public static final String KEY_FIRST_BLOCK = "key_first_block";
    public static final String KEY_FIRST_DGL_BLOCK = "key_first_dgl_block";
    /**
     * 区块hash与区块本身的key value映射，key的前缀，如{key_block_xxxxxxx -> blockJson}
     */
    public static final String KEY_BLOCK_HASH_PREFIX = "key_block_";

    public static final String KEY_REQUEST_PREFIX = "key_request_";
    /**
     * 保存区块的hash和下一区块hash，key为hash，value为下一区块hash
     */
    public static final String KEY_BLOCK_NEXT_PREFIX = "key_next_";
    public static final String KEY_DGLBLOCK_NEXT_PREFIX = "key_next_dgl_";
    /**
     * 每个表的权限存储key
     */
    public static final String KEY_PERMISSION = "key_permission_";
}

